import { getStringByName } from "CoffeeSdk"

export class ButtonConfig {
  title: string = ""
  backgroundColor = ""
  foregroundColor = ""
  clickHandler?: () => ConfirmDialogT2Result
  tag: ConfirmDialogT2ButtonTag = ConfirmDialogT2ButtonTag.Normal

  constructor(title: string) {
    this.title = title;
  }
}

export class ConfirmDialogT2Config {
  leftButtonConfig: ButtonConfig = new ButtonConfig(getStringByName("confirm"));
  rightButtonConfig: ButtonConfig = new ButtonConfig(getStringByName("cancel"));
  middleButtonConfig: ButtonConfig = new ButtonConfig(getStringByName("closePage"))
  closeButtonConfig?: ButtonConfig = new ButtonConfig("");
  showRightBtn: boolean = true;
  showMiddleBtn: boolean = false;
  title: string = getStringByName("cool_reminder_title")
  titleSize: number = 16;
  content: string = ""
  contentSize: number = 14
  onFinish?: (result: ConfirmDialogT2Result) => void

  constructor(content?: string) {
    this.content = content;
    this.leftButtonConfig.tag = ConfirmDialogT2ButtonTag.Ok
    this.rightButtonConfig.tag = ConfirmDialogT2ButtonTag.Cancel
    this.closeButtonConfig.tag = ConfirmDialogT2ButtonTag.Close
    this.middleButtonConfig.tag = ConfirmDialogT2ButtonTag.MiddleButton
  }
}

export class ConfirmDialogT2Result {
  tag: ConfirmDialogT2ButtonTag
  index: number
}

export enum ConfirmDialogT2ButtonTag {
  Ok,
  Cancel,
  Destructive,
  MiddleButton,
  Normal,
  Close,
}

//
// export const ConfirmDialogT2ButtonIndex_0 = 0
// export const ConfirmDialogT2ButtonTag_Ok
//
// export const ConfirmDialogT2ButtonIndex_1 = 1

